/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
      
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.


See LICENSE and AUTHORS for more information.
*/

#ifndef XMPPCONNECTION_H
#define XMPPCONNECTION_H

#include "qxmpp/QXmppClient.h"
#include "qxmpp/QXmppMessage.h"

class XmppConnection : public QXmppClient
{
    Q_OBJECT
public:
    XmppConnection(int uid,int accid, QObject *parent = 0);
public slots:
    void messageReceived(const QXmppMessage &);
    void presenceChanged(const QString& type, const QString& status);
    void iqReceived(const QXmppIq&);
    void sendMessageActive(const QString& bareJid, const QString& message);
    void sendState(QString jid, QString state);

signals:
    void msgRecv(QString from, QString to, QString msg, int accid,int uid);
    void statusChanged(QString,QString,QString,QString,int,int);
    void stateChanged(QString from, QXmppMessage::State state,int accid, int uid);

private slots:
    void parseRoster();

private:
    int accid;
    int uid;
};

#endif // XMPPCONNECTION_H
